	<!-- start about us -->
		<?php
		//初始化模板参数:$this->aboutusTitle、$this->aboutusTitleImg
		$this->aboutusTitle = 
		'近期活动旨在更为直观的汇总近期学校内将要举办的各类讲座比赛，
		消息来源于教务处、校团委以及青春广场上的各类通知';
		$this->aboutusTitleImg = $this->baseUrl().'/images/recentactTitleImg.jpg';
		
		$aboutusLayout = new Zend_Layout();
		echo $aboutusLayout->render('/module/aboutus');
		?>
	<!-- end about us -->
	
	<!-- start logos -->
	<div class="logos">
		
	</div>
	<!-- end logos -->
	
	<!-- start content -->
	<div id="vg-content" >

		<!-- start portfolio details -->
		<div id="portfolio-details" class="vg-page" >
		
			<!-- start details -->
			<?php
//	左侧信息
				$this->fromhref = '?fromhref=/answersystem/index';
				if($this->isloggin==true)
				{
				    $userinfoLayout = new Zend_Layout();
				    echo $userinfoLayout->render('/module/userinfo');
				}
				else 
				{
				    //左侧登录
					$loginLayout = new Zend_Layout();
					echo $loginLayout->render('/module/login');
				} 
			?>
			<article class="border-top c-four">
				<div class="vg-item-article vg-portfolio-details">
					<!-- title -->
					<!-- end title -->
					<!-- upload start -->
					<!-- upload ends -->
					<!-- download list start -->

					<div class="answersystemblock">
						<div class="indexblock">
						<ul>
						<?php
							foreach($this->alllistapp as $app)
							{
							    if($app['status']!=1)
							    {
							        echo '<li><a href="'.$this->baseUrl().'/answersystem/teacherdetail?id='.$app['id'].'#panswersystem">'.'您';
							        if($app['status']==3)echo '[决定]';
							        else echo '[准备';
							        echo ']在'.gmdate('Y年m月d日H:i',$app['date']).'答疑-'.$app['class'].'</a></li>';
							    }
							} 
							//<li><a href="">计算机学院zhijian老师【决定】在2012年08月15日09:00答疑-电子技术</a></li>
						?>
							
						</ul>
						<?php 
							$this->pagerUrl = $this->baseUrl().'/answersystem/index';
							$this->pagerPara = '';
							$aboutusLayout = new Zend_Layout();
							echo $aboutusLayout->render('/module/pager');
						?>
						</div>
					</div>
				
				
				
				
				
					<!-- download list end -->
					<!-- pager start -->
					
					<!-- pager end -->
			  </div>
				
			</article>
			<!-- end details -->
			
	  </div>
	  <!-- end portfolio details -->
	  		<a name="panswersystem" id="panswersystem"></a>
			<div class="answersystemtableblock">
				<form action="<?php echo $this->baseUrl().'/answersystem/teacherdetail?week='.$this->week;?>" method="post">
				<div class="query">
						
							课程名称：<input type="text" id="class" name="class"/>
							答疑最少人数<input type="text" id="threshold" name="threshold"/>
							<button type="submit">提交登记</button>
						<p style="color:red"><?php if(isset($this->tipclass))echo $this->tipclass;?></p><p><?php if(isset($this->tipthreshold))echo $this->tipthreshold;?></p></br>
						请在下表中选择您将要答疑的时间
						<a href="<?php echo $this->baseUrl().'/answersystem/teacherdetail?week='.($this->week+1);?>">下一周  </a><a href="<?php echo $this->baseUrl().'/answersystem/teacherdetail?week='.($this->week-1);?>"> 上一周</a>
				</div>
				
				<div class="weekdays">
				<?php 
					date_default_timezone_set('Asia/Shanghai');
					$weekdayarray = array('周日','周一','周二','周三','周四','周五','周六');
					for($i = 0;$i<7;$i++)
					    echo '<h4>'.$weekdayarray[$i].'<p>'.gmdate('Y/m/d',strtotime($this->daybegin.'-0:0') + $i*24*3600).'</p></h4>'; 
				?>
				
				</div>
				<div class="classtime">
				<h4>第一大节</h4><h4>第二大节</h4><h4>第三大节</h4><h4>第四大节</h4><h4>第五大节</h4>
				</div>
				<div class="table">
					<!-- 
					<div class="grid1"><p align="center" id="p1">计算机学院</p><p align="center" id="p2">冯伟森(25)</p><p align="center" id="p3">离散数学</p><a href="#">[取消]</a><a href="#">[决定]</a></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div>
					<div class="grid"><p>登记<input type="checkbox"/></p></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div>
					<div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div>
					<div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div>
					<div class="grid"></div><div class="grid2"><p align="center" id="p1">计算机学院</p><p align="center" id="p2">冯伟森(25)</p><p align="center" id="p3">离散数学</p><a>[已定]</a><a href="#">[取消]</a></div><div class="grid1"><p align="center" id="p1">计算机学院</p><p align="center" id="p2">冯伟森(25)</p><p align="center" id="p3">离散数学</p><input type="checkbox"/></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div>
					 -->
					
					 
					 <?php
					 	//for($i = )
					 	    //$date = new Zend_Date('2012/8/11');
					 	    //echo $date;
					 	    //$hehe = new Zend_Date($date->get());
					 	    //echo $hehe; 
					 	    //$date->addWeek(1);
					 	    
					 	    //echo $date->getWeekday()
					 	    //print_r(Zend_Locale::getLocaleList());
					 	    //echo $date->get(Zend_Date::WEEKDAY);
					 	    $classtime = $this->classtime;
					 	    date_default_timezone_set('Asia/Shanghai');
					 	    $daybegin = $this->daybegin;
					 	    for($class=0;$class<5;$class++)//注意是从周日开始的
					 	    { 
					 	        for($weekday=0;$weekday<7;$weekday++)
					 	        {
					 	            $time = $daybegin.'-'.$classtime[$class];
					 	            $timecmp = strtotime($time)+$weekday*24*3600;
					 	            if($timecmp<=time()+8*3600 +$this->pretime)
					 	            {
					 	                echo '<div class="grid">';
					 	                echo '<p>已过登记时间</p></div>';
					 	                //echo /*gmdate('Y-m-d H:i:s',*/$timecmp.'</br>'.gmdate('Y-m-d H:i:s',time()+8*3600).'</div>';
					 	                
					 	            }
					 	            else 
					 	            {
					 	                $find = false;
					 	                if(isset($this->allapp))
					 	                {
					 	                    foreach($this->allapp as $key => $app)			 	         
					 	                	{
					 	                    	if($app['date']==$timecmp)
					 	                    	{
					 	                    	    $findindex = $key;
					 	                    	    $find = true;
					 	                    	    break;
					 	                    	}
					 	                	}
					 	                }
					 	                if(!$find)echo '<div class="grid"><p>登记<input type="checkbox" id="'.($class*7+$weekday).'" name="'.($class*7+$weekday).'"/></p></div>';
					 	                else 
					 	                {
											if($this->allapp[$findindex]['status']==2)
											{
											    echo '<div class="grid1" title="已有'.$this->allapp[$findindex]['countstudent'].'位同学登记"><p align="center" id="p1">'.$this->collegearray[$this->allapp[$findindex]['college']].'</p><p align="center" id="p2">'.$this->allapp[$findindex]['teacher'].'('.$this->allapp[$findindex]['countstudent'].')</p>
											    <p align="center" id="p3">'.$this->allapp[$findindex]['class'].'</p>
											    
											    <a href="'.$this->baseUrl().'/answersystem/teachercancel?week='.$this->week.'&&id='.$this->allapp[$findindex]['id'].'">[取消]</a><a href="'.$this->baseUrl().'/answersystem/teachersure?week='.$this->week.'&&id='.$this->allapp[$findindex]['id'].'">[决定]</a></div>';
											     			 	                    
											}
											else if($this->allapp[$findindex]['status']==3)
											{
											    echo '<div class="grid2"><p align="center" id="p1">'.$this->collegearray[$this->allapp[$findindex]['college']].'</p><p align="center" id="p2">'.$this->allapp[$findindex]['teacher'].'</p><p align="center" id="p3">'.$this->allapp[$findindex]['class'].'</p><a>[已定]</a><a href="'.$this->baseUrl().'/answersystem/teachercancel?week='.$this->week.'&&id='.$this->allapp[$findindex]['id'].'">[取消]</a></div>';
											}
											else echo '<div class="grid"><p>登记<input type="checkbox" id="'.($class*7+$weekday).'" name="'.($class*7+$weekday).'"/></p></div>';
					 	                }
					 	            }
					 	            //echo $timecmp.'</br>';
											 	        
					 	        }
					 	        
					 	    }
					 ?>
					 
				</div>
				</form>
		</div>
	</div>
	<!-- end content -->

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-23864149-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  function searchEnter(){
	if(event.keyCode==13){
		document.getElementById('searchform').submit();
		return false;
	}  
  }
</script>






